<template>
  <router-view></router-view>
</template>

<script setup lang="ts">
import { onBeforeMount } from 'vue'

import useUserStore from '@/store/user'

const store = useUserStore()
const { login } = store

onBeforeMount(() => {
  const token = localStorage.getItem('token')
  token && login(token)
})
</script>
